package day15_Thread.demo06_Thread;

//void setDaemon(boolean on)	将此线程标记为守护线程,当运行的线程都是守护线程时,Java虚拟机将退出

public class Test {
    public static void main(String[] args) {
        MyThread tz = new MyThread("兔子");
        MyThread1 wg = new MyThread1("乌龟");
        tz.setDaemon(true);//把兔子标记为守护线程
        //乌龟挂了，兔子存在就没有了意义
        //兔子在乌龟挂了之后，接着就挂了
        tz.start();
        wg.start();
    }
}
